package com.zhn.evsi.task.Alert;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhn.evsi.domain.entity.evsi.EvsiCharacterWalletJournal;
import com.zhn.evsi.service.IEvsiCharacterWalletJournalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class EvsiCharacterWalletAlertTask {

    @Autowired
    private IEvsiCharacterWalletJournalService characterWalletJournalService;

    // 定时扫描sql，如果发现非本人角色转账则标红 (绿色：军团成员转账或者绑定角色之间转账；黄色：给非绑定账号转账； 橙色：给非绑定账号转账且数额大于5e；红色：给非绑定账号转账且数额大于2b；深红色：给非绑定账号转账且数额大于5b)
    @Scheduled(cron = "* 5 20 * * ? ")
    public void characterWalletAlert() {
        log.info("定时器：钱包金额转账预警 <<<< ==== 20:05 / day ==== >>>>");

        List<EvsiCharacterWalletJournal> list = characterWalletJournalService.list(new LambdaQueryWrapper<EvsiCharacterWalletJournal>()
                .eq(EvsiCharacterWalletJournal::getRefType, "player_donation")); // 查出所有角色之间的转账记录

    }
}
